﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using XCore.Domain.Entities;
using XCore.Extensions;

namespace SaaS.Model.Entity.Sites
{
    /// <summary>
    /// 产品表
    /// </summary>
    [Table("Site_Projects")]
    public class Project : Entity<int>, IHasCreationTime
    {
        /// <summary>
        /// 名称
        /// </summary>
        [StringLength(32)]
        public string Name { get; set; }
        /// <summary>
        /// 介绍 支持数组格式 ,号分隔
        /// </summary>
        [StringLength(1024)]
        public string Introduction { get; set; }
        [NotMapped]
        public string[] Introductions
        {
            get
            {
                return this.Introduction.ToEnumerable<string>().ToArray();
            }
        }
        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// 是否发布
        /// </summary>
        public bool IsRelease { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public short Sort { get; set; }
        public int? CreatorUserId { get; set; }
        public DateTime CreationTime { get; set; }
        public int? LastModifyUserId { get; set; }
        public DateTime? LastModifyDate { get; set; }
        public int? DeleteUserId { get; set; }
        public bool IsDeleted { get; set; }
        public DateTime? DeleteTime { get; set; }
    }

}
